<?
include_once 'include/processes.php';
$Login_Process = new Login_Process;
$Login_Process->check_status($_SERVER['SCRIPT_NAME']);
?>

<?

$conn = mysql_connect(DBHOST, DBUSER, DBPASS);
if (!$conn) {
	die("DB error - ".mysql_error());
}
if (!mysql_select_db(DBNAME, $conn)) {
	die("DB error - ".mysql_error());
}

if (!$_POST['id']) {
	echo 'no id';
}

$id = stripslashes($_POST['id']);
$cid = stripslashes($_POST['cid']);
$status = stripslashes($_POST['status']);
$comment = stripslashes($_POST['comment']);
$assigned_user_id = stripslashes($_POST['user_id']);
$modified_user_name = $_SESSION['username'];
$modified_user_id = @mysql_fetch_assoc(mysql_query("select userid from users where username='$modified_user_name'"));
$now = date("Y-m-d H:i:s");

#mysql_query("update dump_files set status='$status' where id='$id'");
mysql_query("update caddr set user_id='$assigned_user_id', comment='$comment', status='$status', modified_user_id='{$modified_user_id[userid]}', modifed_time='$now' where id='$cid'");


?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="REFRESH" content="0;url=<? echo $_SERVER['HTTP_REFERER'];?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

</html>
